import request from '@/utils/request'

export function roles_list(query){
  return request({
    url: '/user/role/',
    method: 'get',
    params: query
  })
}

export function addRole(roleInfo){
  return request({
    url: '/user/role/',
    method: 'post',
    data: roleInfo
  })
}

export function updateRole(roleInfo){
  return request({
    url: `/user/role/${roleInfo.id}/`,
    method: 'patch',
    data: roleInfo
  })
}

export function delRole(role_id){
  return request({
    url: `/user/role/${role_id}/`,
    method: 'delete',
  })
}

export function getRolesList(){
  return request({
    url: '/user/role_list/',
    method: 'get',
  })
}